﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;

namespace YJKCarSlopingPath
{
	public partial class DrawExpandedViewForm : System.Windows.Forms.Form
	{
		public bool DrawLeftDimension
		{
			get
			{
				return this.m_DrawLeftDimension;
			}
		}

		public bool DrawTopDimension
		{
			get
			{
				return this.m_DrawTopDimension;
			}
		}

		public bool Reversed
		{
			get
			{
				return this.m_Reversed;
			}
		}

		public DrawExpandedViewForm()
		{
			this.InitializeComponent();
			this.chkLeftDimesion.Checked = this.m_DrawLeftDimension;
			this.chkTopDimension.Checked = this.m_DrawTopDimension;
			this.chkReversed.Checked = this.m_Reversed;
		}

		private void DrawExpandedViewForm_Load(object sender, EventArgs e)
		{
			string path = Path.GetTempPath() + "DrawExpandedViewForm.dat";
			if (!File.Exists(path))
			{
				return;
			}
			FileStream fileStream = new FileStream(path, FileMode.Open);
			StreamReader streamReader = new StreamReader(fileStream);
			streamReader.BaseStream.Seek(0L, SeekOrigin.Begin);
			this.m_DrawLeftDimension = Convert.ToBoolean(streamReader.ReadLine());
			this.m_DrawTopDimension = Convert.ToBoolean(streamReader.ReadLine());
			this.m_Reversed = Convert.ToBoolean(streamReader.ReadLine());
			this.chkLeftDimesion.Checked = this.m_DrawLeftDimension;
			this.chkTopDimension.Checked = this.m_DrawTopDimension;
			this.chkReversed.Checked = this.m_Reversed;
			streamReader.Close();
			fileStream.Close();
		}

		private void DrawExpandedViewForm_FormClosing(object sender, FormClosingEventArgs e)
		{
			FileStream fileStream = new FileStream(Path.GetTempPath() + "DrawExpandedViewForm.dat", FileMode.Create);
			StreamWriter streamWriter = new StreamWriter(fileStream);
			streamWriter.WriteLine(this.chkLeftDimesion.Checked);
			streamWriter.WriteLine(this.chkTopDimension.Checked);
			streamWriter.WriteLine(this.chkReversed.Checked);
			streamWriter.Flush();
			streamWriter.Close();
			fileStream.Close();
		}

		private void chkLeftDimesion_CheckedChanged(object sender, EventArgs e)
		{
			this.m_DrawLeftDimension = this.chkLeftDimesion.Checked;
		}

		private void chkTopDimension_CheckedChanged(object sender, EventArgs e)
		{
			this.m_DrawTopDimension = this.chkTopDimension.Checked;
		}

		private void chkReversed_CheckedChanged(object sender, EventArgs e)
		{
			this.m_Reversed = this.chkReversed.Checked;
		}

		private bool m_DrawLeftDimension = true;

		private bool m_DrawTopDimension = true;

		private bool m_Reversed;
	}
}
